//
//  MyVillageController.m
//  Village
//
//  Created by 程虎 on 2017/9/14.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "MyVillageController.h"
#import "VillageDetailsViewController.h"

@interface MyVillageController ()

@end

@implementation MyVillageController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    self.tabBarController.tabBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"我的村落";
    [self config_UI];
}

- (void)config_UI
{
    // 添加所有子控制器
    [self setUpAllViewController];
    
    // 设置标题字体
    // 推荐方式
    [self setUpTitleEffect:^(UIColor *__autoreleasing *titleScrollViewColor, UIColor *__autoreleasing *norColor, UIColor *__autoreleasing *selColor, UIFont *__autoreleasing *titleFont, CGFloat *titleHeight,CGFloat *titleWidth) {
//        *titleScrollViewColor = [Util colorWithHexString:@"#f54f34"];
        *norColor = [Util colorWithHexString:@"#4d4d4d"];
        *selColor = [Util colorWithHexString:@"#f54f34"];
        *titleHeight = 44.5;
        // 设置标题字体
        *titleFont = [UIFont systemFontOfSize:15];
        
    }];
    
    // 推荐方式（设置下标）
    [self setUpUnderLineEffect:^(BOOL *isUnderLineDelayScroll, CGFloat *underLineH, UIColor *__autoreleasing *underLineColor,BOOL *isUnderLineEqualTitleWidth) {
        // 标题填充模式
        *underLineColor = [UIColor redColor];
    }];
}

// 添加所有子控制器
- (void)setUpAllViewController
{
    VillageDetailsViewController *wordVc1 = [[VillageDetailsViewController alloc] init];
    wordVc1.title = @"代码证";
    wordVc1.types = 0;
    [self addChildViewController:wordVc1];
    
    VillageDetailsViewController *wordVc2 = [[VillageDetailsViewController alloc] init];
    wordVc2.title = @"组织";
    wordVc2.types = 1;
    [self addChildViewController:wordVc2];
    
    VillageDetailsViewController *wordVc3 = [[VillageDetailsViewController alloc] init];
    wordVc3.title = @"法人";
    wordVc3.types = 2;
    [self addChildViewController:wordVc3];
    
    VillageDetailsViewController *wordVc4 = [[VillageDetailsViewController alloc] init];
    wordVc4.title = @"成员";
    wordVc4.types = 3;
    [self addChildViewController:wordVc4];
    
    VillageDetailsViewController *wordVc5 = [[VillageDetailsViewController alloc] init];
    wordVc5.title = @"其他";
    wordVc5.types = 4;
    [self addChildViewController:wordVc5];
}

@end
